home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / netmail / rnr214.zip / EXEC23P.ZIP / EXTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1989-07-18  |  604b  |  35 lines

  1. program extest;
  2. uses
  3.    crt,
  4.    dos,
  5.    exec;
  6.  
  7. var
  8.    i: integer;
  9.    fn: string [255];
  10.    par: string [130];
  11.  
  12. begin
  13. putenv ('XYZ=This is a test string for the spawned process');
  14.  
  15. repeat
  16.    writeln; write ('EXEC filename,params ("." to exit): ');
  17.    readln (fn);
  18.    writeln;
  19.    if fn = '.'
  20.       then exit;
  21.    i := pos (',', fn);
  22.    if i > 0
  23.       then begin
  24.       par := copy (fn, i + 1, length (fn) - i);
  25.       fn [0] := chr (i - 1);
  26.       end
  27.       else par := '';
  28.  
  29.    i := do_exec (fn, par, 1, $ffff, false);
  30.  
  31.    writeln ('DO_EXEC returned ', i);
  32. until false;
  33. end.
  34.  
  35.